package com.liy.supercloud.ssoclient.security.jwt;

import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;

public class UserAuthConfig {

    @Value("${dascloud.authrization.user.token-header:Authorization}")
    private String tokenHeader;

    @Value("${dascloud.authrization.client.id:default}")
    private String clientId;

    @Value("${dascloud.authrization.client.secret:default}")
    private String clientSecret;

    private byte[] pubKeyByte;


    public String getTokenHeader() {
        return this.tokenHeader;
    }

    public void setTokenHeader(String tokenHeader) {
        this.tokenHeader = tokenHeader;
    }

    public String getToken(HttpServletRequest request) {
        return request.getHeader(this.getTokenHeader());
    }

    public byte[] getPubKeyByte() {
        return this.pubKeyByte;
    }

    public void setPubKeyByte(byte[] pubKeyByte) {
        this.pubKeyByte = pubKeyByte;
    }

    public String getClientId() {
        return this.clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return this.clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }
}
